home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act7 / 00716_buggyhead.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  1.3 KB  |  51 lines

  1. property bugx, bugy, bodychan, bodylist, lipchan, bugbody, buglips, bugsayit, bugsound, bugtempo, hypno, bugtext, mouseout, fluttercount
  2.  
  3. on birth me, lchan, lipset
  4.   set bugx to the locH of sprite lchan
  5.   set bugy to the locV of sprite lchan
  6.   set lipchan to lchan
  7.   puppetSprite(lchan, 1)
  8.   set buglips to lipset
  9.   set fluttercount to 1
  10.   set mouseout to 1
  11.   return me
  12. end
  13.  
  14. on sayit me
  15.   grabbuggy(me)
  16.   if the number of cast bugsound < 1 then
  17.     exit
  18.   end if
  19.   set soundtime to the size of cast bugsound / 183.0
  20.   puppetSound(bugsound)
  21.   updateStage()
  22.   set stime to the timer
  23.   repeat while the timer < (soundtime + stime + 20)
  24.     set dtime to the timer - stime
  25.     if dtime < (soundtime - 20) then
  26.       set the castNum of sprite lipchan to getAt(buglips, random(4))
  27.     else
  28.       set the castNum of sprite lipchan to getAt(buglips, 1)
  29.     end if
  30.     updateStage()
  31.     mydelay(5)
  32.     if the mouseDown and (mouseout = 1) then
  33.       set the castNum of sprite lipchan to getAt(buglips, 1)
  34.       exit
  35.     end if
  36.   end repeat
  37.   set the castNum of sprite lipchan to getAt(buglips, 1)
  38.   releasebuggy(me)
  39. end
  40.  
  41. on releasebuggy me
  42.   puppetSprite(lipchan, 0)
  43.   set hypno to 0
  44. end
  45.  
  46. on grabbuggy me
  47.   puppetSprite(lipchan, 1)
  48.   set the castNum of sprite lipchan to getAt(buglips, 1)
  49.   set hypno to 1
  50. end
  51.